    <!-- 列表CNKI -->
      <template>
  <div class="gd-listLocal">
    <div class="top">
      <div class="le"></div>
      <div class="font">本地知识</div>
    </div>
    <div class="bot">
      <ul>
        <li @click="goToDetail(item)" v-for="(item,index) in dataBase" :key="index">
          <div class="img">
            <span class="iconfont">&#xe625;</span> 
          </div>
          <div class="bot">
                {{item.DatabaseName}}
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { getLocalKnowledge } from "@/api/home"; 

export default {
  name: "information",
  data() {
    return {
      dataBase:[],
    };
  },
  created() {
    this.init();
  },
  mounted() {
   
  },
  filters: {
    ellipsis(value) {
      if (!value) return "";
      if (value.length > 20) {
        return value.slice(0, 20) + "...";
      }
      return value;
    },
  },
  methods: {
      init() {
        getLocalKnowledge("2").then(res=>{ 
          this.dataBase = JSON.parse(res.data.data);
        })
      },
      goToDetail(item){  
       this.$router.push({path:"/singleSearch",query:{
         type:"home",
         data:JSON.stringify({
           type:3,
           pagenow:1,
           pagesize:10, 
           wherestr: "",
           orderstr:"relevant", 
           dbcode:item.DatabaseCode,
         }),
       }});
      },
  },
};
</script>
<style lang="scss" scoped>
@import "../../../assets/css/listLocal.css"; 

.gd-listLocal {
  margin-bottom:0px;
}
</style>